import request from '@/config/axios'

// OA 出差申请 VO
export interface OaBusinessTripApplyVO {
  id: number // 加班申请表主键
  startTime: Date // 开始时间
  endTime: Date // 结束时间
  destination: string // 出差地点
  tripReason: string // 出差事由
  transportation: string // 交通工具
  budgetAmount: number // 预算金额
  accompanyPersons: string // 同行人员
  status: number // 审批结果
  processInstanceId: string // 流程实例的编号
}

// OA 出差申请 API
export const OaBusinessTripApplyApi = {
  // 查询OA 出差申请分页
  getOaBusinessTripApplyPage: async (params: any) => {
    return await request.get({ url: `/bpm/oa-business-trip-apply/page`, params })
  },

  // 查询OA 出差申请详情
  getOaBusinessTripApply: async (id: number) => {
    return await request.get({ url: `/bpm/oa-business-trip-apply/get?id=` + id })
  },

  // 新增OA 出差申请
  createOaBusinessTripApply: async (data: OaBusinessTripApplyVO) => {
    return await request.post({ url: `/bpm/oa-business-trip-apply/create`, data })
  },

  // 修改OA 出差申请
  updateOaBusinessTripApply: async (data: OaBusinessTripApplyVO) => {
    return await request.put({ url: `/bpm/oa-business-trip-apply/update`, data })
  },

  // 删除OA 出差申请
  deleteOaBusinessTripApply: async (id: number) => {
    return await request.delete({ url: `/bpm/oa-business-trip-apply/delete?id=` + id })
  },

  // 导出OA 出差申请 Excel
  exportOaBusinessTripApply: async (params) => {
    return await request.download({ url: `/bpm/oa-business-trip-apply/export-excel`, params })
  },
}